home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group99a.txt / 000147_icon-group-sender _Wed Jul 7 08:11:25 1999.msg < prev    next >
Internet Message Format  |  2000-09-20  |  4KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA00687
  4.     for icon-group-addresses; Wed, 7 Jul 1999 08:09:25 -0700 (MST)
  5. Message-Id: <199907071509.IAA00687@baskerville.CS.Arizona.EDU>
  6. From: "Bob Alexander" <bobalex@ix.netcom.com>
  7. To: "Icon Project" <icon-project@optima.CS.Arizona.EDU>,
  8.         "Icon Group" <icon-group@optima.CS.Arizona.EDU>
  9. Subject: noncase.icn
  10. Date: Sat, 3 Jul 1999 19:28:57 -0700
  11. X-Priority: 3
  12. X-MSMail-Priority: Normal
  13. X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
  14. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  15. Status: RO
  16.  
  17. This is a multi-part message in MIME format.
  18.  
  19. ------=_NextPart_000_001B_01BEC58A.4BC65380
  20. Content-Type: multipart/alternative;
  21.     boundary="----=_NextPart_001_001C_01BEC58A.4BCDF4A0"
  22.  
  23.  
  24. ------=_NextPart_001_001C_01BEC58A.4BCDF4A0
  25. Content-Type: text/plain;
  26.     charset="Windows-1252"
  27. Content-Transfer-Encoding: quoted-printable
  28.  
  29. There were a few messages recently mentioning bugs in the IPL module =
  30. procs/noncase.icn. Sorry I've taken so long to respond to this (I'm the =
  31. author).
  32.  
  33. I had stumbled across and corrected those same bugs a while back (Jan =
  34. '98, if my source code comments are to be believed), but it looks like I =
  35. never submitted the corrected version to the Icon Project. The changes I =
  36. made were virtually identical to the suggestions made in this forum. The =
  37. updated file is attached -- it's small (Icon Project, can you make this =
  38. update to the library?).
  39.  
  40. -- Bob
  41.  
  42. ------=_NextPart_001_001C_01BEC58A.4BCDF4A0
  43. Content-Type: text/html;
  44.     charset="Windows-1252"
  45. Content-Transfer-Encoding: quoted-printable
  46.  
  47. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  48. <HTML><HEAD>
  49. <META content=3D"text/html; charset=3Dwindows-1252" =
  50. http-equiv=3DContent-Type>
  51. <META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
  52. <STYLE></STYLE>
  53. </HEAD>
  54. <BODY bgColor=3D#ffffff>
  55. <DIV><FONT size=3D2>There were a few messages recently mentioning bugs =
  56. in the IPL=20
  57. module procs/noncase.icn. Sorry I've taken so long to respond to this =
  58. (I'm the=20
  59. author).</FONT></DIV>
  60. <DIV> </DIV>
  61. <DIV><FONT size=3D2>I had stumbled across and corrected those same bugs =
  62. a while=20
  63. back (Jan '98, if my source code comments are to be believed), but it =
  64. looks like=20
  65. I never submitted the corrected version to the Icon Project. The changes =
  66. I made=20
  67. were virtually identical to the suggestions made in this forum. The =
  68. updated file=20
  69. is attached -- it's small (Icon Project, can you make this update to the =
  70.  
  71. library?).</FONT></DIV>
  72. <DIV> </DIV>
  73. <DIV><FONT size=3D2>-- Bob</FONT></DIV></BODY></HTML>
  74.  
  75. ------=_NextPart_001_001C_01BEC58A.4BCDF4A0--
  76.  
  77. ------=_NextPart_000_001B_01BEC58A.4BC65380
  78. Content-Type: text/icon;
  79.     name="noncase.icn"
  80. Content-Transfer-Encoding: quoted-printable
  81. Content-Disposition: attachment;
  82.     filename="noncase.icn"
  83. Content-Transfer-Encoding: quoted-printable
  84.  
  85. #########################################################################=
  86. ###
  87. #
  88. #    File:     noncase.icn
  89. #
  90. #    Subject:  Procedures for case-independent matching
  91. #
  92. #    Author:   Robert J. Alexander
  93. #
  94. #    Date:     January 9, 1998
  95. #
  96. #########################################################################=
  97. ###
  98. #
  99. #   This file is in the public domain.
  100. #
  101. #########################################################################=
  102. ###
  103. #
  104. # Kit of case-independent versions of Icon's built-in string-analysis
  105. # procedures.
  106. #
  107. #########################################################################=
  108. ###
  109.  
  110. procedure c_find(s1,s2,i1,i2)
  111.   local scanPos,endPos
  112.   scanPos :=3D match("",s2,i1,i2)
  113.   endPos :=3D many(&cset,s2,i1,i2) | scanPos
  114.   suspend scanPos - 1 + find(map(s1),
  115.       map((if \s2 then s2 else &subject)[scanPos:endPos]))
  116. end
  117.  
  118. procedure c_many(c,s,i1,i2)
  119.   return many(c_cset(c),s,i1,i2)
  120. end
  121.  
  122. procedure c_match(s1,s2,i1,i2)
  123.   local scanPos,endPos
  124.   scanPos :=3D match("",s2,i1,i2)
  125.   endPos :=3D scanPos + *s1
  126.   return (map(s1) =3D=3D map((if \s2 then s2 else =
  127. &subject)[scanPos:endPos]),endPos)
  128. end
  129.  
  130. procedure c_upto(c,s,i1,i2)
  131.   suspend upto(c_cset(c),s,i1,i2)
  132. end
  133.  
  134. procedure c_cset(c)
  135.   static lstring,ustring
  136.   initial {
  137.     lstring :=3D string(&lcase)
  138.     ustring :=3D string(&ucase)
  139.   }
  140.   return cset(map(c) || map(c,lstring,ustring))
  141. end
  142.  
  143. ------=_NextPart_000_001B_01BEC58A.4BC65380--
  144.  
  145.